<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>个人中心</title>
     <link rel="stylesheet" type="text/css" href="../css/amazeui.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/tngou.css" />
</head>
<body>
<div class="am-g" style="background-color:#5EB95E;color: #FFFFFF">
  <div class="am-u-sm-3 am-u-sm-centered am-text-center" style="padding-top: 3px;">
  <img id="portrait" class="am-circle am-img-responsive" /> 
  <span id='account'></span>
 </div>
 <hr style="display: block;height: 0px;border-top: 1px solid #FFFFFF;box-sizing: content-box;">  
 
<ul class="am-avg-sm-3 am-thumbnails am-text-center am-text-sm">
<li>性别：<span id='gender'>男</span> 
</li>

<li>年龄：<span id='age'>保密</span> </li>
<li>注册：<span id='time'></span> </li>

</ul>

  </div>
  

  <div class="am-g">
  <ul class="am-nav">
    <li class="am-nav-divider"></li>
    <li><a href="JavaScript:openWin('memo_add.html','memo_add');" class="am-text-warning"><span class="am-icon-send"></span> 发布说说<span class="am-fr am-icon-chevron-circle-right"></span></a> </li>   
   <li><a href="JavaScript:openWin('user_info.html','user_info');" class="am-text-warning"><span class="am-icon-user"></span> 个人信息<span class="am-fr am-icon-chevron-circle-right"></span></a> </li>
   <li><a href="JavaScript:openWin('friends.html','friends');" class="am-text-warning"><span class="am-icon-users"></span> 我的好友<span class="am-fr am-icon-chevron-circle-right"></span></a> </li>
   <li><a href="JavaScript:openWin('fans.html','fans');" class="am-text-warning"><span class="am-icon-star-o"></span> 我的粉丝<span class="am-fr am-icon-chevron-circle-right"></span></a> </li>  
   <li><a href="JavaScript:openWin('favorites.html','favorites');" class="am-text-warning"><span class="am-icon-folder"></span> 收藏夹<span class="am-fr am-icon-chevron-circle-right"></span></a> </li>
   <li><a href="JavaScript:openWin('msgs.html','msgs');" class="am-text-warning"><span class="am-icon-comments"></span> 我的留言<span class="am-fr am-icon-chevron-circle-right"></span></a> </li>
   <li><a href="tel:13880334484" class="am-text-warning"><span class="am-icon-phone"></span> 联系客服<span class="am-fr am-icon-chevron-circle-right"></span></a> </li>
     <!--
  <li><a href="JavaScript:isBuild();" class="am-text-warning"><span class="am-icon-refresh"></span> 检查更新<span class="am-fr am-icon-chevron-circle-right"></span></a> </li>
  -->
    <li class="am-nav-divider"></li>
</ul>
</div>
<!-- 退出按钮 -->
  <div class="am-g">
  <div class="am-u-sm-8 am-u-sm-centered">
  <button type="button" onclick="exitUser()" class="am-btn am-btn-danger am-btn-block am-round">安全退出</button>
  </div>
  </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script src="../script/jquery.min.js"></script>
<script src="../script/amazeui.min.js"></script>
<script src="../script/config.js"></script>
<script type="text/javascript">
    var user={};
	apiready = function(){
		 
		   api.getPrefs({
		    key: 'user'
		   }, function(ret, err){
		    user= JSON.parse(ret.value); 
		    $("#account").text(user.account);
		    if(user.avatar)
		    {
		    $("#portrait").attr("src",TngouImg+user.avatar);	  
		    }else
		    {
		      $("#portrait").attr("src",TngouImg+'/avatar/default.jpg');	
		    }  
		    $("#time").text(format(user.time));
		    if(user.gender==0)$("#gender").text('女');
		    if(user.birth)$("#age").text(age(user.birth));
//		    alert(user.age);
		    
		   
		});
	};
	
	
	function exitUser()
	{
		$api.rmStorage('access_token');
	    api.removePrefs({
		    key: 'user'
		});
	    showUser('./user_login.html','user_login');
	}
	
	
	function showUser(url,name)
	{	
	    api.openFrame({
	            name: name,
	            showProgress:true,
	            url: url,
	            bounces: false,	        
	            rect: {
	                x: 0,
	                y: 58,
                    w: 'auto',
                    h: api.winHeight-108
	            }
	        }); 	
		
	
	}
	
	
	
	

</script>
</html>